//
//  HTBasController.swift
//  weibo
//
//  Created by JonsonLiu on 2017/2/22.
//  Copyright © 2017年 JonsonLiu. All rights reserved.
//

import UIKit

class HTBasController: UITableViewController,BaseViewDelegate {
    
    var userLogin : Bool = true
    
    override func loadView() {
        if userLogin == true {
            super.loadView()
        }else{
            
            view = baseView
            
            navigationItem.leftBarButtonItem = UIBarButtonItem(title: "注册", style: .plain, target: self, action:#selector(HTBasController.clickRegisterButton))
            
            navigationItem.rightBarButtonItem = UIBarButtonItem(title: "登陆", style: .plain, target: self, action: #selector(HTBasController.clickLoginButton))
        }
        
        
        
    }
    
  
    
    
    func clickLoginButton() {
        let vc = HTOAuthViewController()
        
        self.present(UINavigationController.init(rootViewController: vc), animated: true, completion: nil)
    }
    func clickRegisterButton() {
        print("点击了注册")
    }
    

    private lazy var baseView : BaseView = {
        
            let baseView = BaseView()
        
            baseView .delegate = self
        
            return baseView
        
        }()

//    override func viewDidLoad() {
//        super.viewDidLoad()
//
//        // Uncomment the following line to preserve selection between presentations
//        // self.clearsSelectionOnViewWillAppear = false
//
//        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
//        // self.navigationItem.rightBarButtonItem = self.editButtonItem()
//    }

   
}
